<?php if (!defined("BASEPATH")) exit("No direct script access allowed"); ?>


<a data-toggle="dropdown" class="dropdown-toggle" href="#">
	<i class="fa fa-envelope"></i>
	<span class="label label-success" id="unreadMessagesCnt"><?=$getUnreadMessagesCnt?></span>
</a>

<ul class="dropdown-menu" id="messageDropdownMenu">
	<li class="header"><?=$this->lang->line("YOU_HAVE")." ".$getUnreadMessagesCnt." ".strtolower($this->lang->line("NEW")." ".$this->lang->line("MESSAGE".($getUnreadMessagesCnt > 1 ? "S" : "")))?></li>
	<? if($getUnreadMessagesCnt) { ?>
		<li>
			<!-- inner menu: contains the actual data -->
			<div class="slimScrollDiv" style="position: relative; overflow: hidden; width: auto; height: 200px;"><ul class="menu" style="overflow: hidden; width: 100%; height: 200px;">
				<? foreach($getUnreadMessages as $mes) { ?>
					<li><!-- start message -->
						<a href="<?=site_url("admin_lte/messages/".$mes["mesUniqueId"])?>">
							<h4 style="margin-left: 0;">
								<? $sender = explode("@", $mes["senderUsrEmail"]); ?>
								<p class="pull-left"><?=$sender[0]."@"?></p>
								<p class="pull-right"><small><i class="fa fa-clock-o"></i> <?=$mes["mesCreatedate"]?></small></p>
								<div class="clearfix"></div>
							</h4>
							<p style="margin-left: 0; text-overflow:ellipsis; overflow: hidden;"><?=$mes["mesMessage"]?></p>
						</a>
					</li><!-- end message -->
				<? } ?>
			</ul><div class="slimScrollBar" style="background: none repeat scroll 0% 0% rgb(0, 0, 0); width: 3px; position: absolute; top: 0px; opacity: 0.4; display: block; border-radius: 0px; z-index: 99; right: 1px;"></div><div class="slimScrollRail" style="width: 3px; height: 100%; position: absolute; top: 0px; display: none; border-radius: 0px; background: none repeat scroll 0% 0% rgb(51, 51, 51); opacity: 0.2; z-index: 90; right: 1px;"></div></div>
		</li>
	<? } ?>
	<li class="footer"><a href="<?=site_url("admin_lte/messages")?>"><?=$this->lang->line("SEE_ALL_MESSAGES")?></a></li>
</ul>